﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class GroupedTimeline : System.Web.UI.Page {
    System.Random rnd = new Random();
    protected void Page_Load(object sender, EventArgs e) {

        if(!Page.IsPostBack) {
            int max = 25;
            Timeline1.DataSourceType = TimelineNet.DataSourceTypes.named;
            Timeline1.TimelineData = new TimelineNet.Library.TimelineData();
            string[] Groups = new string[] { "A", "B", "C"};
            Timeline1.BubbleHeight = 100;
            Timeline1.BubbleWidth = 100;

            for(int x = 0;x <= max;x++) {
                DateTime start = DateTime.Now.AddMonths(rnd.Next(x) * -1);
                DateTime end = start.AddDays(rnd.Next(30));
                TimelineNet.Library.GroupedEvent evt = new TimelineNet.Library.GroupedEvent(start, end, false, "Event " + x, "", "", "");
                evt.GroupName = Groups[rnd.Next(Groups.Length)];
                Timeline1.TimelineData.Add(evt);
            }
        }
    }
}
